<?php
include_once 'includes/utilities.php';
$con = OpenDB();
$filtro = mysql_real_escape_string($_POST["filtro"]);
$tipo = $_POST['tipo'];
if ($tipo == 'filtro')
{
    $query = "SELECT * FROM microscopia_template WHERE template like '" . $filtro . "%' or codigo like '" . $filtro . "%'";
} else
{
    $query = "SELECT * FROM microscopia_template";
}
$microscopias = GetSQL($query);
echo mysql_error();
CloseDB($con);
if ($microscopias)
{
    for ($i = 0; $i < count($microscopias); $i++)
    {
        ?>
        <tr class="fila">
            <td><?php echo utf8_encode($microscopias[$i]['codigo']); ?></td>
            <td><?php echo utf8_encode($microscopias[$i]['template']); ?></td>
            <td width="50">
                <a href="" class="modificar" id="<?php echo $microscopias[$i]['codigo']; ?>"><img alt="modificar" title="Modificar" src="imagenes/modificar.png" /></a>
                <a href="" class="eliminar" id="<?php echo $microscopias[$i]['codigo']; ?>"><img alt="eliminar" title="Eliminar" src="imagenes/eliminar.gif" /></a>
            </td>
        </tr>
        <?php
    }
}
?>
<script type="text/javascript" src="js/color.js"></script>
